package com.iqik.sc.controller;

import com.iqik.sc.service.ResumeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/resume")
public class ResumeController {

    @Autowired
    private ResumeService resumeService;

    @GetMapping("/openstate/{userId}")
    public Integer findDefaultResumeState(@PathVariable Long userId) {
        try {
            Thread.sleep(10000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("=============================request=============================");
        return resumeService.findDefaultResumeByUserId(userId).getIsOpenResume();
    }

    @Value("${server.port}")
    private Integer port;

    @GetMapping("/port")
    public Integer getPort() {
        return port;
    }

}
